package com.slipper.system.sequence.front;

import java.util.List;
import com.slipper.common.bo.Result;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

import com.slipper.system.api.sequence.bo.SequenceBO;
import com.slipper.system.api.sequence.service.ISequenceSv;
import com.slipper.system.sequence.service.SequenceService;
import com.slipper.common.util.ResultUtil;

@RestController
public class SequenceSv implements ISequenceSv {
    @Resource
    private SequenceService sequenceService;
    
    @Override
    public Result<SequenceBO> queryBy(String id) {
        return ResultUtil.successResult(sequenceService.queryBy(id));
    }
    
    @Override
    public Result<List<SequenceBO>> queryPage(SequenceBO bo) {
        return ResultUtil.successResult(sequenceService.queryPage(bo));
    }
    
    @Override
    public Result<?> save(SequenceBO bo) {
        return ResultUtil.saveResult(sequenceService.save(bo));
    }
    
    @Override
    public Result<?> delete(SequenceBO bo) {
        return ResultUtil.deleteResult(sequenceService.delete(bo));
    }

    @Override
    public Result<String> getNextSequence(String flagId) {
        return ResultUtil.successDataResult(sequenceService.getNextSequence(flagId));
    }
}
